package com.ptsz.mydatbase.tianditu;/*
 * Copyright 2017 wshunli
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import com.esri.arcgisruntime.arcgisservices.LevelOfDetail;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.SpatialReference;

import java.util.ArrayList;
import java.util.List;

public class LayerInfoFactory {
//    private static String key = "da18bdf25ae788b6c59a015ef5f0e4f1"; //国家天地图
//    static {
//        if (BaseMapApi.getInstance().getGjTdtTK() != null) {
//            key = BaseMapApi.getInstance().getGjTdtTK();
//        }
//    }
    private static final String URL_VECTOR_2000 = "http://t1.tianditu.gov.cn/vec_c/wmts";
    private static final String URL_VECTOR_ANNOTATION_CHINESE_2000 = "http://t1.tianditu.gov.cn/cva_c/wmts";
    private static final String URL_VECTOR_ANNOTATION_ENGLISH_2000 = "http://t1.tianditu.gov.cn/eva_c/wmts";
    private static final String URL_IMAGE_2000 = "http://t1.tianditu.gov.cn/img_c/wmts";
    private static final String URL_IMAGE_ANNOTATION_CHINESE_2000 = "http://t1.tianditu.gov.cn/cia_c/wmts";
    private static final String URL_IMAGE_ANNOTATION_ENGLISH_2000 = "http://t1.tianditu.gov.cn/cia_c/wmts";
    private static final String URL_TERRAIN_2000 = "http://t1.tianditu.gov.cn/ter_c/wmts";
    private static final String URL_TERRAIN_ANNOTATION_CHINESE_2000 = "http://t1.tianditu.gov.cn/cta_c/wmts";

    private static final String URL_IMAGE_GZ_2000 = "http://61.243.3.233:8034/arcgis/rest/services/GZS2021DOM3/MapServer/WMTS";
    private static final String URL_IMAGE_GZ_ANNOTATION_CHINESE_2000 = "http://61.243.3.233:8034/arcgis/rest/services/cia2021_c/MapServer/WMTS";


    private static final String URL_IMAGE_WFX_2000 = "http://61.243.1.124:8088//landSurvey/geo/wmts";
//    private static final String URL_IMAGE_WFX_2000 = "http://61.243.1.124:8088/geowebcache/service/wmts";


    private static final String URL_VECTOR_MERCATOR = "http://t1.tianditu.gov.cn/vec_w/wmts";
    private static final String URL_VECTOR_ANNOTATION_CHINESE_MERCATOR = "http://t1.tianditu.gov.cn/cva_w/wmts";
    private static final String URL_VECTOR_ANNOTATION_ENGLISH_MERCATOR = "http://t1.tianditu.gov.cn/eva_w/wmts";
    private static final String URL_IMAGE_MERCATOR = "http://t1.tianditu.gov.cn/img_w/wmts";
    private static final String URL_IMAGE_ANNOTATION_CHINESE_MERCATOR = "http://t1.tianditu.gov.cn/cia_w/wmts";
    private static final String URL_IMAGE_ANNOTATION_ENGLISH_MERCATOR = "http://t1.tianditu.gov.cn/cia_w/wmts";
    private static final String URL_TERRAIN_MERCATOR = "http://t1.tianditu.gov.cn/ter_w/wmts";
    private static final String URL_TERRAIN_ANNOTATION_CHINESE_MERCATOR = "http://t1.tianditu.gov.cn/cta_w/wmts";

    private static final String LAYER_NAME_VECTOR = "vec";
    private static final String LAYER_NAME_VECTOR_ANNOTATION_CHINESE = "cva";
    private static final String LAYER_NAME_VECTOR_ANNOTATION_ENGLISH = "eva";
    private static final String LAYER_NAME_IMAGE = "img";
    private static final String LAYER_NAME_IMAGE_ANNOTATION_CHINESE = "cia";
    private static final String LAYER_NAME_IMAGE_ANNOTATION_ENGLISH = "eia";
    private static final String LAYER_NAME_TERRAIN = "ter";
    private static final String LAYER_NAME_TERRAIN_ANNOTATION_CHINESE = "cta";

    private static final String LAYER_NAME_IMAGE_GZ = "GZSYX2019DOM3";
    private static final String LAYER_NAME_IMAGE_GZ_ANNOTATION_CHINESE = "GZSYX2019DOM_va";
    private static final String LAYER_NAME_IMAGE_FWX = "fwxAll";
    private static final String LAYER_NAME_IMAGE_FWX2 = "spyx";

    private static final String TILE_MATRIX_SET_MERCATOR = "w";
    private static final String TILE_MATRIX_SET_2000 = "c";

    private static final String TILE_MATRIX_SET_GZ_2000 = "default";
    private static final String TILE_MATRIX_SET_FWX_2000 = "EPSG:4490_fwxAll";
    private static final String TILE_MATRIX_SET_FWX2_2000 = "EPSG:4490_spyx";

    //    private static final int SRID_2000 = 4326;    //WGS_84
    private static final int SRID_2000 = 4490;
    private static final Point ORIGIN_2000 = new Point(-180, 90,
            SpatialReference.create(LayerInfoFactory.SRID_2000));
    private static final int SRID_MERCATOR = 4490;
    private static final Point ORIGIN_MERCATOR = new Point(-20037508.3427892,
            20037508.3427892,
            SpatialReference.create(LayerInfoFactory.SRID_MERCATOR));
//    private static final double X_MIN_2000 = -180;
//    private static final double Y_MIN_2000 = -90;
//    private static final double X_MAX_2000 = 180;
//    private static final double Y_MAX_2000 = 90;

//    private static final double X_MIN_2000 = 103.36;
//    private static final double Y_MIN_2000 = 24.37;
//    private static final double X_MAX_2000 = 109.35;
//    private static final double Y_MAX_2000 = 29.13;

    private static final double X_MIN_2000 = 103.36;
    private static final double Y_MIN_2000 = 24.37;
    private static final double X_MAX_2000 = 109.80;
    private static final double Y_MAX_2000 = 29.30;

    private static final double X_MIN_MERCATOR = -20037508.3427892;
    private static final double Y_MIN_MERCATOR = -20037508.3427892;
    private static final double X_MAX_MERCATOR = 20037508.3427892;
    private static final double Y_MAX_MERCATOR = 20037508.3427892;

    //    private static final double[] SCALES = {2.958293554545656E8,
//            1.479146777272828E8, 7.39573388636414E7, 3.69786694318207E7,
//            1.848933471591035E7, 9244667.357955175, 4622333.678977588,
//            2311166.839488794, 1155583.419744397, 577791.7098721985,
//            288895.85493609926, 144447.92746804963, 72223.96373402482,
//            36111.98186701241, 18055.990933506204, 9027.995466753102,
//            4513.997733376551, 2256.998866688275, 1127.2338602399827,
//            563.6169301199914};//
    private static final double[] SCALES = {400000000, 295497598.5708346, 147748799.285417,
            73874399.6427087, 36937199.8213544, 18468599.9106772,
            9234299.95533859, 4617149.97766929, 2308574.98883465,
            1154287.49441732, 577143.747208662, 288571.873604331,
            144285.936802165, 72142.9684010827, 36071.4842005414,
            18035.7421002707, 9017.87105013534, 4508.93552506767, 2254.467762533835};//

    private static final double[] RESOLUTIONS_MERCATOR = {1.40625, 0.703125, 0.3515625, 0.17578125,
            0.087890625, 0.0439453125, 0.02197265625, 0.010986328125,
            0.0054931640625, 0.00274658203125, 0.001373291015625,
            0.0006866455078125, 0.00034332275390625, 0.000171661376953125,
            8.58306884765629E-05, 4.29153442382814E-05, 2.14576721191407E-05,
            1.07288360595703E-05, 5.36441802978515E-06};

    private static final double[] RESOLUTIONS_2000 = {0.7031249999891485,
            0.35156249999999994, 0.17578124999999997, 0.08789062500000014,
            0.04394531250000007, 0.021972656250000007, 0.01098632812500002,
            0.00549316406250001, 0.0027465820312500017, 0.0013732910156250009,
            0.000686645507812499, 0.0003433227539062495,
            0.00017166137695312503, 0.00008583068847656251,
            0.000042915344238281406, 0.000021457672119140645,
            0.000010728836059570307, 0.000005364418029785169,
            2.682209014892579e-006, 1.3411045074462895e-006};//

    private static List<LevelOfDetail> getLods102100() {
        List<LevelOfDetail> lods = new ArrayList<LevelOfDetail>();
        lods.add(new LevelOfDetail(1, 78271.51696402048, 2.958293554545656E8));
        lods.add(new LevelOfDetail(2, 39135.75848201024, 1.479146777272828E8));
        lods.add(new LevelOfDetail(3, 19567.87924100512, 7.39573388636414E7));
        lods.add(new LevelOfDetail(4, 9783.93962050256, 3.69786694318207E7));
        lods.add(new LevelOfDetail(5, 4891.96981025128, 1.848933471591035E7));
        lods.add(new LevelOfDetail(6, 72445.98490512564, 9244667.35795517));
        lods.add(new LevelOfDetail(7, 1222.99245256282, 4622333.678977588));
        lods.add(new LevelOfDetail(8, 611.49622628141, 2311166.839488794));
        lods.add(new LevelOfDetail(9, 305.748113140705, 1155583.419744397));
        lods.add(new LevelOfDetail(10, 152.8740565703525, 577791.7098721985));
        lods.add(new LevelOfDetail(11, 76.43702828517625, 288895.85493609926));
        lods.add(new LevelOfDetail(12, 38.21851414258813, 144447.92746804963));
        lods.add(new LevelOfDetail(13, 19.109257071294063, 72223.96373402482));
        lods.add(new LevelOfDetail(14, 9.554628535647032, 36111.98186701241));
        lods.add(new LevelOfDetail(15, 4.777314267823516, 18055.990933506204));
        lods.add(new LevelOfDetail(16, 2.388657133911758, 9027.995466753102));
        lods.add(new LevelOfDetail(17, 1.194328566955879, 4513.997733376551));
        lods.add(new LevelOfDetail(18, 0.5971642834779395, 2256.998866688275));
        return lods;
    }

    private static List<LevelOfDetail> getLods2000() {
        List<LevelOfDetail> lods = new ArrayList<LevelOfDetail>();
        lods.add(new LevelOfDetail(1, 0.7031249999891485, 2.958293554545656E8));
        lods.add(new LevelOfDetail(2, 0.35156249999999994, 1.479146777272828E8));
        lods.add(new LevelOfDetail(3, 0.17578124999999997, 7.39573388636414E7));
        lods.add(new LevelOfDetail(4, 0.08789062500000014, 3.69786694318207E7));
        lods.add(new LevelOfDetail(5, 0.04394531250000007, 1.848933471591035E7));
        lods.add(new LevelOfDetail(6, 0.021972656250000007, 9244667.357955175));
        lods.add(new LevelOfDetail(7, 0.01098632812500002, 4622333.678977588));
        lods.add(new LevelOfDetail(8, 0.00549316406250001, 2311166.839488794));
        lods.add(new LevelOfDetail(9, 0.0027465820312500017, 1155583.419744397));
        lods.add(new LevelOfDetail(10, 0.0013732910156250009, 577791.7098721985));
        lods.add(new LevelOfDetail(11, 0.000686645507812499, 288895.85493609926));
        lods.add(new LevelOfDetail(12, 0.0003433227539062495, 144447.92746804963));
        lods.add(new LevelOfDetail(13, 0.00017166137695312503, 72223.96373402482));
        lods.add(new LevelOfDetail(14, 0.00008583068847656251, 36111.98186701241));
        lods.add(new LevelOfDetail(15, 0.000042915344238281406, 18055.990933506204));
        lods.add(new LevelOfDetail(16, 0.000021457672119140645, 9027.995466753102));
        lods.add(new LevelOfDetail(17, 0.000010728836059570307, 4513.997733376551));
        lods.add(new LevelOfDetail(18, 0.000005364418029785169, 2256.998866688275));
        return lods;
    }

    private static List<LevelOfDetail> getLodsGZ2000() { //贵州天地图
        List<LevelOfDetail> list = new ArrayList<>();
        list.add(new LevelOfDetail(0, 1.4078260157100582, 5.91657527591555E8));
        list.add(new LevelOfDetail(1, 0.7031250000000002, 2.9549759305875003E8));
        list.add(new LevelOfDetail(2, 0.3515625000000001, 1.4774879652937502E8));
        list.add(new LevelOfDetail(3, 0.17578125000000006, 7.387439826468751E7));
        list.add(new LevelOfDetail(4, 0.08789062500000003, 3.6937199132343754E7));
        list.add(new LevelOfDetail(5, 0.043945312500000014, 1.8468599566171877E7));
        list.add(new LevelOfDetail(6, 0.021972656250000007, 9234299.783085939));
        list.add(new LevelOfDetail(7, 0.010986328125000003, 4617149.891542969));
        list.add(new LevelOfDetail(8, 0.005493164062500002, 2308574.9457714846));
        list.add(new LevelOfDetail(9, 0.002746582031250001, 1154287.4728857423));
        list.add(new LevelOfDetail(10, 0.0013732910156250004, 577143.7364428712));
        list.add(new LevelOfDetail(11, 6.866455078125002E-4, 288571.8682214356));
        list.add(new LevelOfDetail(12, 3.433227539062501E-4, 144285.9341107178));
        list.add(new LevelOfDetail(13, 1.7166137695312505E-4, 72142.9670553589));
        list.add(new LevelOfDetail(14, 8.583068847656253E-5, 36071.48352767945));
        list.add(new LevelOfDetail(15, 4.2915344238281264E-5, 18035.741763839724));
        list.add(new LevelOfDetail(16, 2.1457672119140632E-5, 9017.870881919862));
        list.add(new LevelOfDetail(17, 1.0728836059570316E-5, 4508.935440959931));
        list.add(new LevelOfDetail(18, 5.364418029785158E-6, 2254.4677204799655));
        list.add(new LevelOfDetail(19, 2.682209014892579E-6, 1127.2338602399827));
        list.add(new LevelOfDetail(20, 1.3411045074462895E-6, 563.6169301199914));
        return list;
    }

    private static List<LevelOfDetail> getLodsFWXAll2000() {
        List<LevelOfDetail> list = new ArrayList<>();
        list.add(new LevelOfDetail(0, 1.4078260157100582, 5.91657527591555E8));
        list.add(new LevelOfDetail(1, 0.7031250000000002, 2.9549759305875003E8));
        list.add(new LevelOfDetail(2, 0.3515625000000001, 1.4774879652937502E8));
        list.add(new LevelOfDetail(3, 0.17578125000000006, 7.387439826468751E7));
        list.add(new LevelOfDetail(4, 0.08789062500000003, 3.6937199132343754E7));
        list.add(new LevelOfDetail(5, 0.043945312500000014, 1.8468599566171877E7));
        list.add(new LevelOfDetail(6, 0.021972656250000007, 9234299.783085939));
        list.add(new LevelOfDetail(7, 0.010986328125000003, 4617149.891542969));
        list.add(new LevelOfDetail(8, 0.005493164062500002, 2308574.9457714846));
        list.add(new LevelOfDetail(9, 0.002746582031250001, 1154287.4728857423));
        list.add(new LevelOfDetail(10, 0.0013732910156250004, 577143.7364428712));
        list.add(new LevelOfDetail(11, 6.866455078125002E-4, 288571.8682214356));
        list.add(new LevelOfDetail(12, 3.433227539062501E-4, 144285.9341107178));
        list.add(new LevelOfDetail(13, 1.7166137695312505E-4, 72142.9670553589));
        list.add(new LevelOfDetail(14, 8.583068847656253E-5, 36071.48352767945));
        list.add(new LevelOfDetail(15, 4.2915344238281264E-5, 18035.741763839724));
        list.add(new LevelOfDetail(16, 2.1457672119140632E-5, 9017.870881919862));
        list.add(new LevelOfDetail(17, 1.0728836059570316E-5, 4508.935440959931));
        list.add(new LevelOfDetail(18, 5.364418029785158E-6, 2254.4677204799655));
        list.add(new LevelOfDetail(19, 2.682209014892579E-6, 1127.2338602399827));
//        list.add(new LevelOfDetail(20, 1.3411045074462895E-6, 563.6169301199914));
        return list;
    }

    public static TianDiTuLayerInfo getLayerInfo(int layerType) {
        TianDiTuLayerInfo layerInfo = new TianDiTuLayerInfo();
        switch (layerType) {
            case TianDiTuLayerTypes.TIANDITU_IMAGE_2000:
                layerInfo.setUrl(LayerInfoFactory.URL_IMAGE_2000);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_CHINESE_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_ANNOTATION_CHINESE_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_ENGLISH_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_ANNOTATION_ENGLISH_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_ANNOTATION_ENGLISH);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_CHINESE_MERCATOR:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_ANNOTATION_CHINESE_MERCATOR);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_ENGLISH_MERCATOR:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_ANNOTATION_ENGLISH_MERCATOR);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_ANNOTATION_ENGLISH);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_MERCATOR:
                layerInfo.setUrl(LayerInfoFactory.URL_IMAGE_MERCATOR);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE);
                break;
            case TianDiTuLayerTypes.TIANDITU_VECTOR_2000:
                layerInfo.setUrl(LayerInfoFactory.URL_VECTOR_2000);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_VECTOR);
                break;
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_CHINESE_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_VECTOR_ANNOTATION_CHINESE_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_VECTOR_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_ENGLISH_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_VECTOR_ANNOTATION_ENGLISH_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_VECTOR_ANNOTATION_ENGLISH);
                break;
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_CHINESE_MERCATOR:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_VECTOR_ANNOTATION_CHINESE_MERCATOR);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_VECTOR_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_ENGLISH_MERCATOR:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_VECTOR_ANNOTATION_ENGLISH_MERCATOR);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_VECTOR_ANNOTATION_ENGLISH);
                break;
            case TianDiTuLayerTypes.TIANDITU_VECTOR_MERCATOR:
                layerInfo.setUrl(LayerInfoFactory.URL_VECTOR_MERCATOR);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_VECTOR);
                break;
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_2000:
                layerInfo.setUrl(LayerInfoFactory.URL_TERRAIN_2000);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_TERRAIN);
                break;
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_ANNOTATION_CHINESE_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_TERRAIN_ANNOTATION_CHINESE_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_TERRAIN_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_MERCATOR:
                layerInfo.setUrl(LayerInfoFactory.URL_TERRAIN_MERCATOR);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_TERRAIN);
                break;
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_ANNOTATION_CHINESE_MERCATOR:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_TERRAIN_ANNOTATION_CHINESE_MERCATOR);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_TERRAIN_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_GZ_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_GZ_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_GZ);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_GZ_ANNOTATION_CHINESE_2000:
                layerInfo.setUrl(LayerInfoFactory.URL_IMAGE_GZ_ANNOTATION_CHINESE_2000);
                layerInfo.setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_GZ_ANNOTATION_CHINESE);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_FWX_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_WFX_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_FWX);
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_FWX2_2000:
                layerInfo
                        .setUrl(LayerInfoFactory.URL_IMAGE_WFX_2000);
                layerInfo
                        .setLayerName(LayerInfoFactory.LAYER_NAME_IMAGE_FWX2);
                break;
        }
        handleLayerInfo(layerInfo, layerType);
        return layerInfo;
    }

    private static void handleLayerInfo(TianDiTuLayerInfo layerInfo,
                                        int layerType) {
        switch (layerType) {
            case TianDiTuLayerTypes.TIANDITU_IMAGE_2000:
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_CHINESE_2000:
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_ENGLISH_2000:
            case TianDiTuLayerTypes.TIANDITU_VECTOR_2000:
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_CHINESE_2000:
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_ENGLISH_2000:
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_2000:
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_ANNOTATION_CHINESE_2000:
                layerInfo.setOrigin(LayerInfoFactory.ORIGIN_2000);
                layerInfo.setSrid(LayerInfoFactory.SRID_2000);
                layerInfo.setxMin(LayerInfoFactory.X_MIN_2000);
                layerInfo.setyMin(LayerInfoFactory.Y_MIN_2000);
                layerInfo.setxMax(LayerInfoFactory.X_MAX_2000);
                layerInfo.setyMax(LayerInfoFactory.Y_MAX_2000);
                layerInfo.setScales(LayerInfoFactory.SCALES);
                layerInfo.setResolutions(LayerInfoFactory.RESOLUTIONS_2000);
                layerInfo.setTileMatrixSet(LayerInfoFactory.TILE_MATRIX_SET_2000);
                layerInfo.setLods(getLods2000());
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_CHINESE_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_IMAGE_ANNOTATION_ENGLISH_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_IMAGE_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_CHINESE_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_VECTOR_ANNOTATION_ENGLISH_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_VECTOR_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_MERCATOR:
            case TianDiTuLayerTypes.TIANDITU_TERRAIN_ANNOTATION_CHINESE_MERCATOR:
                layerInfo.setOrigin(LayerInfoFactory.ORIGIN_MERCATOR);
                layerInfo.setSrid(LayerInfoFactory.SRID_MERCATOR);
                layerInfo.setxMin(LayerInfoFactory.X_MIN_MERCATOR);
                layerInfo.setyMin(LayerInfoFactory.Y_MIN_MERCATOR);
                layerInfo.setxMax(LayerInfoFactory.X_MAX_MERCATOR);
                layerInfo.setyMax(LayerInfoFactory.Y_MAX_MERCATOR);
                layerInfo.setScales(LayerInfoFactory.SCALES);
                layerInfo.setResolutions(LayerInfoFactory.RESOLUTIONS_MERCATOR);
                layerInfo.setTileMatrixSet(LayerInfoFactory.TILE_MATRIX_SET_MERCATOR);
                layerInfo.setLods(getLods102100());
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_GZ_2000: //贵州天地图标注
                layerInfo.setOrigin(LayerInfoFactory.ORIGIN_2000);
                layerInfo.setSrid(LayerInfoFactory.SRID_2000);
                layerInfo.setxMin(LayerInfoFactory.X_MIN_2000);
                layerInfo.setyMin(LayerInfoFactory.Y_MIN_2000);
                layerInfo.setxMax(LayerInfoFactory.X_MAX_2000);
                layerInfo.setyMax(LayerInfoFactory.Y_MAX_2000);
                layerInfo.setScales(LayerInfoFactory.SCALES);
                layerInfo.setResolutions(LayerInfoFactory.RESOLUTIONS_2000);
                layerInfo.setTileMatrixSet(LayerInfoFactory.TILE_MATRIX_SET_GZ_2000);
                layerInfo.setLods(getLodsGZ2000());
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_GZ_ANNOTATION_CHINESE_2000: //贵州天地图标注
                layerInfo.setOrigin(LayerInfoFactory.ORIGIN_MERCATOR);
                layerInfo.setSrid(LayerInfoFactory.SRID_MERCATOR);
                layerInfo.setxMin(LayerInfoFactory.X_MIN_MERCATOR);
                layerInfo.setyMin(LayerInfoFactory.Y_MIN_MERCATOR);
                layerInfo.setxMax(LayerInfoFactory.X_MAX_MERCATOR);
                layerInfo.setyMax(LayerInfoFactory.Y_MAX_MERCATOR);
                layerInfo.setScales(LayerInfoFactory.SCALES);
                layerInfo.setResolutions(LayerInfoFactory.RESOLUTIONS_2000);
                layerInfo.setTileMatrixSet(LayerInfoFactory.TILE_MATRIX_SET_GZ_2000);
                layerInfo.setLods(getLodsGZ2000());
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_FWX_2000:
                layerInfo.setOrigin(LayerInfoFactory.ORIGIN_2000);
                layerInfo.setSrid(LayerInfoFactory.SRID_2000);
                layerInfo.setxMin(LayerInfoFactory.X_MIN_2000);
                layerInfo.setyMin(LayerInfoFactory.Y_MIN_2000);
                layerInfo.setxMax(LayerInfoFactory.X_MAX_2000);
                layerInfo.setyMax(LayerInfoFactory.Y_MAX_2000);
                layerInfo.setScales(LayerInfoFactory.SCALES);
                layerInfo.setResolutions(LayerInfoFactory.RESOLUTIONS_2000);
                layerInfo.setTileMatrixSet(LayerInfoFactory.TILE_MATRIX_SET_FWX_2000);
                layerInfo.setLods(getLodsFWXAll2000());
                break;
            case TianDiTuLayerTypes.TIANDITU_IMAGE_FWX2_2000:
                layerInfo.setOrigin(LayerInfoFactory.ORIGIN_2000);
                layerInfo.setSrid(LayerInfoFactory.SRID_2000);
                layerInfo.setxMin(LayerInfoFactory.X_MIN_2000);
                layerInfo.setyMin(LayerInfoFactory.Y_MIN_2000);
                layerInfo.setxMax(LayerInfoFactory.X_MAX_2000);
                layerInfo.setyMax(LayerInfoFactory.Y_MAX_2000);
                layerInfo.setScales(LayerInfoFactory.SCALES);
                layerInfo.setResolutions(LayerInfoFactory.RESOLUTIONS_2000);
                layerInfo.setTileMatrixSet(LayerInfoFactory.TILE_MATRIX_SET_FWX2_2000);
                layerInfo.setLods(getLodsFWXAll2000());
                break;
        }
    }
}
